import { TableColumnObject } from 'amis/lib/renderers/Table'
import serverColumnUtils, { ServerColumnUtilsProps } from '@/components/amis/ServerColumnUtils/serverColumnUtils'
import ossApplicationAdminService from '@/core/oss/generated/service/admin/ossApplicationAdminService'

class OssAppIdColumnUtils {
	getSchema = (parmas?: Partial<ServerColumnUtilsProps>): TableColumnObject => {
		return serverColumnUtils.getSchema(
			Object.assign(
				{
					name: 'ossAppId',
					label: '对象存储应用',
					valueField: 'id',
					labelField: 'title',
					getByIdsWithDebounce: ossApplicationAdminService.getByIdsWithDebounce,
				},
				parmas,
			),
		)
	}
}

export default new OssAppIdColumnUtils()
